/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.synjones.pay.bank.wisedu.service;

import com.synjones.pay.bank.wisedu.bean.WiseduPayReturnReqBean;

import com.synjones.pay.model.context.IPayContext;
import com.synjones.pay.model.context.PayRequest;
import com.synjones.pay.model.context.PayResponse;
import java.util.Map;

/**
 * @author liubinqiang
 * @date 2017-5-20 14:09:15
 * @version V1.0
 * @desc
 */
public class WisPayTest {

    private static final String SYS_CERT = "tvBAAvQhyAIIBVt6w8m9ieCSgLP4wEyGUzcSveAHZl0eM76mPoZm79VSVNsfxFt7jIFKbWYlnqyiSUtwwWyxD46mXAQKa1mMhjW3FpFYLCKtMSjRn5GNp3dTyKQL48kt";

    public static void verify() {
        //payPassword=B44EB28E8F8435A7,overTime=20170531163156,status=1,projectId=751,itemId=0005-01,version=3,
        //payId=2176910,sign=955b172a66c9f4a167efe9f33a13cfcd,amount=0.11,paid=0.11,objName=测试缴费0531,sysId=0005,
        //specialValue=,refund=0.00,payType=网银,objId=sn20170531-02,otherId=,
        WiseduPayReturnReqBean bean = new WiseduPayReturnReqBean();
        bean.setSign("sign");
        bean.setVersion("version");
        bean.setSysId("sysId");
        bean.setItemId("itemId");
        bean.setObjId("objId");
        bean.setOtherId("otherId");
        bean.setObjName("objName");
        bean.setAmount("amount");
        bean.setPaid("paid");
        bean.setRefund("refund");
        bean.setOverTime("overTime");
        bean.setStatus("status");
        bean.setProjectId("projectId");
        bean.setPayId("payId");
        bean.setPayPassword("payPassword");
        bean.setSpecialValue("specialValue");
        bean.setPayType("payType");

        String genSign = bean.genSign(SYS_CERT);
        boolean result = bean.getSign().equals(genSign);

    }

    public static void main(String[] args) {

//        verify();
        WisBankJumpImpl wispay = new WisBankJumpImpl();
        IPayContext payContext = new IPayContext() {
            @Override
            public PayRequest getRequest() {
                //CommonConstant.TRADE_OBJ
                //PayRequest payRequest = new PayRequest();
                return null;
            }

            @Override
            public PayResponse getResponse() {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
            }
        };

        Map<String, String> resp = wispay.doPay(payContext);

    }
}
